ParagraphGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A generate 0 11 2
1
import Generator from './Base';
2
3
/**
4
 * Generates a random paragraph.
5
 * @description a couple of sentences
6
 * @returns {string} paragraph
7
 * @requires int
8
 * @requires sentence
9
 * @generator
10
 */
11
export default class ParagraphGenerator extends Generator {
12
    generate() {
13
        // eslint-disable-next-line no-magic-numbers
14
        const count = this.fatum.int(2, 8);
15
        const text = [];
16
17
        for (let i = 0; i < count; i++) {
18
            text.push(this.fatum.sentence());
19
        }
20
21
        return text.join(' ');
22
    }
23
}
24